import request from '@/api/request';

/**
 * 分页
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const clientPageApi = query => {
    return request({
        url: '/api/mgt/client/page',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 详情
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const clientDetailApi = query => {
    return request({
        url: '/api/mgt/client/getDetail',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 添加
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const clientSaveApi = query => {
    return request({
        url: '/api/mgt/client/save',
        method: 'post',
        data: query,
        isLoading: true
    });
};

/**
 * 编辑
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const clientEditApi = query => {
    return request({
        url: '/api/mgt/client/edit',
        method: 'put',
        data: query,
        isLoading: true
    });
};

/**
 * 编辑状态
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const clientEditStatusApi = query => {
    return request({
        url: '/api/mgt/client/editStatus',
        method: 'put',
        params: query,
        isLoading: true
    });
};

/**
 * 删除
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const clientRemoveApi = query => {
    return request({
        url: '/api/mgt/client/removeByIds',
        method: 'delete',
        params: query,
        isLoading: true
    });
};

/**
 * 重置密匙
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const clientEditSecretApi = query => {
    return request({
        url: '/api/mgt/client/editSecret',
        method: 'put',
        params: query,
        isLoading: true
    });
};
